SCS Events

Action Sequences

Action Sequences are core to almost all interactions between the various components in an Event.  An Action Sequence defines a list of things to do in response to a trigger.  The trigger could be manual (Manual Trigger / button) or automated (Auto Trigger).  Action Sequences are the meat of the Event and are arguably the most complicated part.  All user created Manual Triggers and Auto Triggers have to start at least one Action Sequence.  The Action Sequence abstracts the actions which should be performed in response to the trigger.

 

Action Sequences can operate in 1 of 3 modes:

Single
Ensures 1 and only 1 run of the sequence is occurring at any given moment. If the Action Sequence is triggered again before a prior run of it's action list has completed then the new request is ignored.
Multiple
Allows runs to be executed in parallel.  When triggered the sequence is executed immediately regardless of whether other runs are still being processed or not.  This can get very complicated quickly, if you choose this mode do so after thinking through the potential pitfalls.
Single Queued
Similar to Single, this ensures only 1 run of the action sequence is executing at any given moment.  However if the sequence is triggered while a previous run is still being processed instead of ignoring it (Single mode) or executing it immediately (Multiple mode) the Queued mode will add the request to a queue. Once the prior run finishes the next one in the queue is executed and so forth until the queue is emptied.

 

Action Sequences have one of the most detailed Property Panes of all components.  

 

 

 

 

 

 

The Execution Mode is detailed above, depending on the use case you are building your event to accomplish one mode will most likely make more sense then another.  

 

 

 

 

 

 

 

 

 

 

The main part of the Action Sequence is defining the list of actions which comprise the sequence.  This is done by using the buttons at the bottom of the Property Pane.  

 

Each action item added to the list is executed sequentially based upon their assigned Execution Order.  If two actions have equal Execution Orders then they are executed in parallel.  

 

 

 

 

 

 

 

 

The +Action button allows you to add an action item to the sequence.  Clicking it will pop up a dialog with all the various action types you can execute.  

Some values might be empty or not make sense until you create a required component.  For instance you cannot add an action to start an Output until you have an Output defined.

 

Meta Item - Update

This action will update any sensor or global Meta Item components you check.  When executed Sensor Meta Items will be updated to the latest value obtained from the Data Hub, Global Meta Items will get their current value from the Event Logger Service.  

 

Meta Item - Increment

This action will increment any numeric Meta Item you check.  You can define the amount you wish to increment by.  Decimal increments will be ignored if you try to increment a numeric Meta Item of type Integer.

 

Meta Item - Change

This action allows you to override whatever the current value of the checked Meta Items are with another value.  This will only work for Manual Meta Items, you can not change sensor, global or summary Meta Items.  

This can be a useful way to provide a lot of functionality in your UI without taking up much space.  For instance, lets say you have 20 types of objects you want to deploy off the ship.  Lets say you want to deploy 10 of one, then proceed to deploy 10 of the next type, etc.  You could have 20 Meta Items, each representing the number of object 'x' currently deployed.  Or you could have a single Meta Item and once it reaches 10 you simply reset it's value back to 0.

 

Output

This action allows you to perform actions on the various Outputs you have defined.  If the Output is Continuous you can start or stop it.  If it is Discrete/Snapshot then you can update it.  Simply check the Output you want to act on and select the action you wish to perform if applicable.

 

Manual Trigger - Click

This action allows you to automatically press a Manual Trigger.  This will cause the system to respond as if you manually clicked the button and will trigger all Action Sequences associated with that trigger.

 

Manual Trigger - Rename

This action is similar to the Meta Item - Change action mentioned above, however this action acts against a Manual Trigger.  Essentially this allows you to automatically change the Label of an existing Manual Trigger, so for example if you had 2 types of buoys to deploy and you wanted to deploy 10 of Buoy A and then 10 of Buoy B then you could create a Manual Trigger named "Deploy Buoy A" and after 10 presses simply change it's name to "Deploy Buoy B".

 

Manual Trigger - Hide

This action removes a Manual Trigger from the screen, thereby preventing users from clicking on it as they cannot see it to begin with!  This works in conjunction with Manual Trigger - Show by removing a visible button from the UI.  It has no effect on buttons already hidden.

Be careful hiding buttons which belong to groups as you may put your event into a logically unsound state!  For instance, if you have a group with forced order and you hide a button then it cannot be clicked and you may block that group from proceeding until the button is shown.  This may be the exact logic you wish to implement of course, but just be sure to give these workflows thought when hiding/showing.

 

Manual Trigger - Show

This action re-displays a Manual Trigger from the screen.  This works in conjunction with Manual Trigger - Hide by putting a previously hidden button back onto the UI.  It has no effect on buttons already visible.

 

Alarms

This action is used to trigger alarms defined inside this event template.

 

 

Progress Bar

This action is used to increment a progress bar by 1.  

 

Timer Start / Stop / Reset

The timer actions act upon existing Timer components in the exact manner in which they are described.  Use the Timer Start action to start a timer, use the Timer Stop action to stop a timer and use the Timer Reset action to reset a timer back to 00:00:00.

 

Execute Web Hook

This action will make a call (POST) to a remote RESTful API.  This can be used to trigger procedures in other systems external to SCS, for instance launch some custom python code written by the science party or update another systems database or website, etc.  This requires a remote web-service to be running and accessible over TCP/IP from the SCS server. 

You can include URL parameters as you deem necessary however these will be static and part of the hard-coded URL in the action. 

SCS sensor data can also be sent in the call if needed.  If you select data field values to include in the POST then SCS will add the latest values at the time the call is made to the body of the request.  

Details on handling this in your code can be found in the Event API Action section of the documentation.

 

 

 

The +Time Delay button allows you to add a time delay to the sequence of actions.  Clicking it will pop up a dialog where you can enter the amount of time you wish to delay.  Any action items which are in the next higher execution order will be blocked and will not start until this timer completes.  If no additional action items are in the sequence then the sequence itself will continue to block other instances (if execution mode is not Multiple) until the timer completes.

 

A Time Delay can be used whenever you know beforehand the static amount of time needed between two actions.  For instance, if you know that a trawl net should only be on bottom for 30 minutes (randomly chosen duration for demo purposes only) then you can setup a timer to start when the net hits bottom and then send out alarms or perform any other actions automatically after 30 minutes. 

Be careful with the Execution Order here, setting the wrong order can render your timer pointless. 

 

 

 

The +Audio button allows you to insert audible sounds into the sequence of actions.  Clicking it will pop up a dialog where you can select a short sound clip to play.  As you select different options you'll hear them play locally.  Click the green arrow/play button to re-play them if desired.  Any action items which are in the next higher execution order will be blocked and will not start until the sound clip completes.  

 

Audio files can be linked to multiple elements of the Event via this Action.  For example, you could play a sound whenever a user clicks a button.  You could play a sound once you've deployed 10 buoys (utilizing an Automatic Trigger with a Meta Item reference).  You could play a sound when a timer expires and so on.

 

If you're unsure which sound to use just select the first sound clip and use the up/down arrows on your keyboard to move through the list.  This will play each sound clip for you without a lot of mouse clicking.

You can also chain audio clips by taking one short one and repeating it with another Audio action over and over again making it a longer one.  This would be more useful for an alarm or something you REALLY want people to pay attention to.

 

 

 

The +Stop Event button allows you to stop the event.  In prior versions of SCS this would be the equivalent of manually clicking the "Stop Event" button.  By putting this into an action you are able to stop the event via a variety of means.  You can still create a "Stop Event" Manual Trigger of course, however there may be cases where one or more triggers would be cause to end the Event.  For instance perhaps in a trawl event once the net is on-board you would normally want to end the event.  If so when creating the Action Sequence to handle the net coming on board simply add a Stop Event action to the end of the sequence.  When the net comes aboard the event will automatically end.

 

 

The Sort button automatically sorts all actions in the list according to their currently assigned execution order.  It does not change the execution order, only sorts the list so you can visualize the sequence in the order things would execute.  This would only be relevant if you have changed the order of one or more action items, otherwise actions are added in a sequential manner by default.

 

 

List of Actions

As you add actions to the sequence they will be displayed at the bottom of the Property Pane.  The first column provides a button to Delete the action from the sequence, followed by a button to Edit the action.  The next column allows you to change the actions Execution Order which is relative to other actions. 

 

For instance, in the example below there are 8 action items to be executed when this sequence is triggered.  Since the first 3 have the lowest Execution Order they will execute first.  Since they have the same Execution Order (1) those three actions will execute in parallel.  

Once all three of those actions are complete the next action in the order will execute (2 - Start the Demo Continuous Output).

Once (2) has finished the next in the list will execute.  There is no action with a Execution Order of 3 so the next in the list would be (4 - Manual Trigger Click).  

This continues until we get to the last action (8 - Web Hook), once that one completes the sequence is ended.

Be aware that the Execution Order values are what determine the sequence of execution, NOT the visual order in the list.  If you change orders it's best practice to hit the Sort button once you are done so you are not accidentally misunderstanding the order of execution.

 

SCSv5                                                                                                        Page 1 of 1